package com.test.account;


public class Main {

    public static void main(String[] args) {
        Account account = new Account(0);
        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 100000; i++) {
                    account.deposit(1);
                }
                System.out.println(account.getNum());
            }
        }).start();
        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 100000; i++) {
                    account.withdraw(1);
                }
                System.out.println(account.getNum());
            }
        }).start();
    }
}
